<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>BSM测试页面</title>
</head>
<script type="text/javascript" src="js/jquery-2.1.4.js"></script>
	<script>

	function formToJson(formObj){
	   var o={};
	   var a=formObj.serializeArray();
	   $.each(a, function() {
	       if(this.value){
	           if (o[this.name]) {
	               if (!o[this.name].push) {
	                   o[this.name]=[ o[this.name] ];
	               }
	                   o[this.name].push(this.value || null);
	           }else {
	               if($("[name='"+this.name+"']:checkbox",formObj).length){
	                   o[this.name]=[this.value];
	               }else{
	                   o[this.name]=this.value || null;
	               }
	           }
	       }
	   });
	   return o;
	};
	
	$(document).ready(function() { 
	 
		//查询
	$(':button').click( function () {
		var url = $(this).parent().attr("action");
		var param  = formToJson($(this).parent());
		$.ajax({ 
				url: url, 
				type: "POST",
				data: JSON.stringify(param),
				dataType:"json",
				contentType:"application/json; charset=utf-8",
				success: function(data){
					var dataJson = JSON.stringify(data);
			}, error: function(request, error, status){  
	            // todo: 错误处理  
	        }  });
		});
		
	});
</script>
<body>
		
		<fieldset>
			<div>
			<div>玄武---订购</div>
			<div>
				<form action="rest/1.2/xuanwu/order">
					订购id: <input name="orderId" value=""/> <br/>
					手机号码: <input name="mobile" value=""/> <br/>
					产品id: <input name="productCode" value=""/> <br/>
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
		
		<fieldset>
			<div>
			<div>兆泰---查询状态 </div>
			<div>
				<form action="rest/1.2/zhaotai/order/status">
					订购id: <input name="orderId" value=""/> <br/>
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
		
		<fieldset>
			<div>
			<div>兆泰--订购</div>
			<div>
				<form action="rest/1.2/zhaotai/order">
					orderId: <input name="orderId" value=""/> <br/>
					phoneNo:<input name="mobile" value=""/> <br/>
					productSize: <input name="productSize" value=""/><br/>
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
		
		<fieldset>
			<div>
			<div>云之讯---查询状态 </div>
			<div>
				<form action="rest/1.2/yunzx/order/orderStatus">
					订购id: <input name="orderId" value=""/> <br/>
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
		
		<fieldset>
			<div>
			<div>云之讯--订购</div>
			<div>
				<form action="rest/1.2/yunzx/order">
					orderId: <input name="orderId" value=""/> <br/>
					phoneNo:<input name="phoneNo" value=""/> <br/>
					productSize: <input name="productSize" value=""/><br/>
					region: <input name="region" value=""/><br/>
					（0全国 1省内）
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
		
		<br><br>
		<fieldset>
			<div>
			<div>掌厅开放平台接口--实时订购(江苏电信产品)</div>
			<div>
				<form action="rest/1.2/jszt/order">
					phoneNo: <input name="phoneNo" value="18015018282"/> <br/>
					productId:<input name="productId" value=""/> <br/>
					productName: <input name="productName" value="流量优惠/流量赠送"/><br/>
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
		
		
		<br><br>
		<fieldset>
			<div>
			<div>流量门户充送接口(韶山电信)</div>
			<div>
				<form action="rest/1.2/menhu/order">
					phoneNo: <input name="phoneNo" value="18928901746"/> <br/>
					productCode:<input name="productCode" value=""/> <br/>
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
		
		<br><br>
		<fieldset>
			<div>
			<div>流量门户充送结果查询接口(韶山电信)</div>
			<div>
				<form action="rest/1.2/menhu/order/orderStatus">
					sessionId: <input name="sessionId" value="3425"/> <br/>
					<input type="button" value="发送"/>
				</form>
			</div>
		</div>
		</fieldset>
	
	
</body>
</html>